package com.hxd.otc.module.my.adapter;

import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hxd.otc.R;
import com.hxd.otc.module.order.bean.StableCurrencyBean;
import com.hxd.otc.utils.CommonUtil;
import com.hxd.otc.utils.StringUtil;
import com.hxd.otc.utils.UIUtils;
import com.hxd.otc.widget.BlocksToast;

/**
 * 包  名 :  com.hxd.otc.module.order.adapter
 * 类  名 :  OllOrderAdapter
 * 作  者 :  zjl
 * 时  间 :  2018/6/5 18:03
 * 描  述 :  ${全部订单页面}
 */
public class StableCurrencyAdapter extends BaseQuickAdapter<StableCurrencyBean.StableCurrencyData, BaseViewHolder> {


    public StableCurrencyAdapter() {
        super(R.layout.adapter_stable_currency, null);
    }

    @Override
    protected void convert(BaseViewHolder helper, final StableCurrencyBean.StableCurrencyData item) {

        helper.setText(R.id.tv_coin_name, item.coinType);
        helper.setText(R.id.tv_number, StringUtil.format8Number(item.coinAmount));
        helper.setText(R.id.tv_proportion, StringUtil.format2Number(item.coinRate * 100) + "%");
        helper.setText(R.id.tv_address, item.coinAddress);

        helper.getView(R.id.tv_address).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                CommonUtil.copyData(item.coinAddress);
                BlocksToast.get().showToast(UIUtils.getContext().getString(R.string.copy_address_hint));
            }
        });

    }

}
